<form name="UnavailabilityAddEdit" method="POST" action="{$FormAction}">
    <input type="hidden" name="formSubmitted" value="1" />
    <input type="hidden" name="unaId" value="{$Unavailability_Id}" />
    <input type="hidden" name="retURL" value="{$retURL}" />
	<table id="table" width="100%" cellpadding="3" cellspacing="0" class="form" border="0">
	  <thead>
	  <tr>
		<td colspan="4">&nbsp;</td>
	  </tr>
	  </thead>
	  <tbody>
	  <tr>
		<td>{t}Reason for unavailability{/t}: </td>
		<td>
			<input type="text" name="Unavailability_Purpose" value="{$Unavailability_Purpose}" />
		</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	  </tr>
	  <tr>
		<td>{t}Beginning date{/t}: </td>
		<td>
			<span id="show_Date1" style="background-color:#E1E8EF;border:1px #000000 dotted;
				margin: 3px 3px 3px 3px;padding: 3px 3px 3px 3px;text-align: right;">
				{if $Unavailability_BeginDate != 0}{$Unavailability_BeginDate_Display}{else}-- {t}Select a date{/t} --{/if}
			</span>
            <input type="hidden" name="Unavailability_BeginDate" id="f_date_c1" value="{if $Unavailability_BeginDate != 0}{$Unavailability_BeginDate}{/if}" />
            &nbsp;
			<input type="button" name="f_trigger_c1" id="f_trigger_c1" value="..."
                style="cursor: pointer;" title="{t}Select a date{/t}" />
		</td>
		<td>{t}End date{/t}: </td>
		<td>
			<span id="show_Date2" style="background-color:#E1E8EF;border:1px #000000 dotted;
				margin: 3px 3px 3px 3px;padding: 3px 3px 3px 3px;text-align: right;">
				{if $Unavailability_EndDate != 0}{$Unavailability_EndDate_Display}{else}-- {t}Select a date{/t} --{/if}
			</span>
            <input type="hidden" name="Unavailability_EndDate" id="f_date_c2" value="{if $Unavailability_EndDate != 0}{$Unavailability_EndDate}{/if}" />
            &nbsp;
			<input type="button" name="f_trigger_c2" id="f_trigger_c2" value="..."
                style="cursor: pointer;" title="{t}Select a date{/t}" />
		</td>
	  </tr>
	  </tbody>
	  <tfoot>
	  <tr>
	    <td colspan="4">
		  <input type="button" value="{t}Cancel{/t}" name="cancel" onClick="window.location='{$retURL}'" class="Button">
		  &nbsp;
		  <input type="submit" name="Ok" value="{t}Ok{/t}" class="button"
		  	onclick="return checkForm(this.form, requiredFields);">
		</td>
	  </tr>
	  </tfoot>
	</table>
</form>
{literal}
<script type="text/javascript">
	Calendar.setup({
        inputField     :    "f_date_c1",         // id of the input field (hidden)
        ifFormat       :    "%Y-%m-%d %H:%M:00",  // format of the input field
		displayArea    :    "show_Date1",         // ID of the span where the date is to be shown
		daFormat       :    "%A %e %B %Y %H:%M",  // format of the displayed date
        button         :    "f_trigger_c1",       // trigger for the calendar (button ID)
        align          :    "Tl",                 // alignment (defaults to "Bl")
		date		   :	"", 				  // date affichee par defaut
        singleClick    :    true,
		dateStatusFunc :	dateStatusHandler     // permet d'afficher des dates speciales diffaremment (jours feries)
												  // et d'en desactiver (en fonction du planning de l'Actor
    });
	Calendar.setup({
        inputField     :    "f_date_c2",     	  // id of the input field
        ifFormat       :    "%Y-%m-%d %H:%M:00",  // format of the input field
		displayArea    :    "show_Date2",         // ID of the span where the date is to be shown
		daFormat       :    "%A %e %B %Y %H:%M",  // format of the displayed date
        button         :    "f_trigger_c2",  	  // trigger for the calendar (button ID)
        align          :    "Tl",           	  // alignment (defaults to "Bl")
		date		   :	"", 				  // date affichee par defaut
        singleClick    :    true,
		dateStatusFunc :	dateStatusHandler
    });
</script>
{/literal}
